package com.lujianfei.filesend.db.dao

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import com.lujianfei.filesend.db.model.TransferFile

@Dao
interface TransferFileDao {

    @Query("SELECT * FROM transfer_file WHERE md5 = :md5")
    fun findOne(md5: String): TransferFile?

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insertAll(equipTypeList: List<TransferFile>): List<Long>?

    @Query("DELETE FROM transfer_file where md5 = :md5")
    fun deleteByMd5(md5: String)
}